﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CTSexercises
{
    public class Person
    {
        private string name;
        private uint? age;

        #region Constructor and properties

        public Person()
            : this(null, null)
        { }

        public Person(string name, uint? age = null)
        {
            this.name = name;
            this.age = age;
        }

        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
            }
        }

        public uint? Age
        {
            get
            {
                return age;
            }
            set
            {
                age = value;
            }
        }

        #endregion

        public override string ToString()
        {
            StringBuilder output = new StringBuilder();

            if (this.name != null)
            {
                output.Append(name);
                output.Append(" ");
            }
            else
            {
                output.Append("Name not specified ")
            }

            if(this.age != null)
            {
                output.Append(age);
            }
            else
            {
                output.Append("age not specified.")
            }

            return output.ToString();
        }
    }
}
